<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>模板字符串</title>
  <script>
    /**
     * 1. 模板字符串用法 (非常重要)
     */
    function fun1(){
      // 1.1 原样显示内容
      let list = `<ul>
            <li>沈腾</li>
            <li>玛丽</li>
            <li>魏翔</li>
            <li>艾伦</li>
            </ul>`
      // 1.2 可以在模板字符串中读取指定变量值
      let page = 1,pageSize = 5
      let url = `/student/findByPage/${page}/${pageSize}`
      console.log("url: ",url)
      let name = "张三"
      let age = 20
      const info = `我叫${name},今年${age}岁了！`
      const info2 = "我叫" + name +",今年 " + age + "岁了！"
      console.log(list)
      console.log(info)
      console.log(info2)
    }
    fun1()
  </script>
</head>
<body>

</body>
</html>
